package qc.module.platform.mapper;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import qc.module.platform.dto.dict.DictCategoryDto;
import qc.module.platform.entity.QcDictCategory;

import java.util.List;

/**
 * DictCategoryMapper
 *
 * @author QuCheng Tech
 * @since 2024/3/9
 */
@Mapper
public interface DictCategoryMapper {
    DictCategoryMapper MAPPER = Mappers.getMapper(DictCategoryMapper.class);

    @Mapping(target = "dictcode",source = "code")
    QcDictCategory toEntity(DictCategoryDto dto);
    @Mapping(target = "code",source = "dictcode")
    DictCategoryDto toDto(QcDictCategory en);

    List<DictCategoryDto> toDtoList(List<QcDictCategory> list);

}
